#ifndef _WORLD_
#define _WORLD_

#include <iostream>
#include <string>

#include "Tribe.h"
#include "Menagerie.h"

namespace Hunger
{
	class World
	{
	public:
		enum Weather { Fair, Cloudy, Windy, Rainy, Thunderstorm, Snow, Blizzard };

		enum Disaster { No_Disaster, Earthquake, Fire, Tornado, Flood };

		enum Pestilence { No_Pestilence, Human_Plague, Animal_Plague };

		static World * Instance();
		~World();

		void Begin();

	protected:
		World();
		
	private:
		void BeginNewDay();
		void AffectTribes();
		void AffectMenagerie();

		void DisplaySelf();

		void DetermineDaysUntilWinter();

		void DetermineWeather();
		void DetermineDisaster();
		void DeterminePestilence();

		int FigureDisasterPercentage();
		int FigurePestilencePercentage();

		bool DidTribeSurvive();

	private:
		static World * instance;

		Tribe * mainTribe;

		Menagerie * menagerie;

		int daysUntilWinter;
		int daysPassed;

		int currentWeather;
		int currentDisaster;
		int currentPestilence;

		int numDisasters;
		int numPestilences;

		bool winterHasCome;

		bool disasterYesterday;
		bool pestilenceYesterday;
	};
}
#endif //_HUNGER_WORLD_